package org.dllwh.milvus.v1;

import io.milvus.client.MilvusServiceClient;
import io.milvus.param.ConnectParam;
import org.dllwh.milvus.config.MilvusConfig;

/**
 * 把今天最好的表现当作明天最新的起点．．～
 * <p>
 * Today the best performance as tomorrow the newest starter!
 *
 * @ClassName MilvusConnectHelper
 * @Description Milvus V1 连接操作
 * @Author: <a href="mailto:duleilewuhen@sina.com">独泪了无痕</a>
 * @Date 2025-05-24 14:34
 * @版本 V 1.0.1
 * @since JDK 17
 */
public class MilvusConnectHelper {
    /**
     * 创建 Milvus 客户端
     */
    public static MilvusServiceClient getMilvusServiceClient() {
        ConnectParam connectParam = ConnectParam.newBuilder()
                .withHost(MilvusConfig.host)
                .withPort(MilvusConfig.port)
                .withAuthorization(MilvusConfig.userName, MilvusConfig.password)
                .withDatabaseName(MilvusConfig.databaseName)
                .build();
        return new MilvusServiceClient(connectParam);
    }
}
